Skip to content

Add IsTrimmable and IsAotCompatible project attributes#188

Merged
TylerBrinks merged 3 commits into
TylerBrinks:masterfrom
maxkatz6:aot-compat
Jul 23, 2025
Merged

Add IsTrimmable and IsAotCompatible project attributes#188
TylerBrinks merged 3 commits into
TylerBrinks:masterfrom
maxkatz6:aot-compat

Conversation

@maxkatz6
Copy link
Copy Markdown
Contributor

These attributes should help finding potential incompatibilities with PublishTrimmed or PublishAot applications.

Specifically in my case I got this error (while having warnings as erros enabled):

ILC : Trim analysis error IL2067: ExCSS.AttributeSelectorFactory.Create(String,String,String,String): 'type' argument does not satisfy 'DynamicallyAccessedMemberTypes.PublicConstructors' in call to 'System.Activator.CreateInstance(Type,Object[])'. The parameter '#ILLink.Shared.TypeSystemProxy.ParameterIndex' of method 'System.Collections.Generic.Dictionary`2<String,Type>.TryGetValue(String,Type&)' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to.

There are multiple ways to fix this issue, and it's possible to keep Activator.CreateInstance usage, or add lambda methods in the dictionary. But I though this method is simple enough to just use if-tree instead of dictionary

@TylerBrinks TylerBrinks merged commit c97e84d into TylerBrinks:master Jul 23, 2025
@hcoona
Copy link
Copy Markdown

hcoona commented Jul 28, 2025

I really love this PR and want to know when will ExCSS release a new version (or even a prerelease version) to NuGet to include this AOT support.

@TylerBrinks
Copy link
Copy Markdown
Owner

Latest is pushed to NuGet

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants